package org.elephantt.webby;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class HttpExceptionResponder implements Responder {
  public void respond(HttpServletRequest request, HttpServletResponse response, Object controllerReturnValue) throws IOException {
    HttpException exception = (HttpException) controllerReturnValue;
    response.sendError(exception.getCode(), exception.getMessage());    
  }
}
